home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / PictUtils.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  6.6 KB  |  204 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        PictUtils.a
  3. ;
  4. ;    Contains:    Picture Utilities Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__PICTUTILS__') = 'UNDEFINED' THEN
  21. __PICTUTILS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  30.     include 'Windows.a'
  31.     ENDIF
  32. ;        include 'Memory.a'                                            ;
  33. ;            include 'MixedMode.a'                                    ;
  34. ;        include 'Quickdraw.a'                                        ;
  35. ;            include 'QuickdrawText.a'                                ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'OSUtils.a'                                    ;
  38. ;        include 'Controls.a'                                        ;
  39. ;            include 'Menus.a'                                        ;
  40.  
  41.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  42.     include 'Palettes.a'
  43.     ENDIF
  44.  
  45. returnColorTable                EQU        $0001
  46. returnPalette                    EQU        $0002
  47. recordComments                    EQU        $0004
  48. recordFontInfo                    EQU        $0008
  49. suppressBlackAndWhite            EQU        $0010
  50.  
  51. ; color pick methods 
  52. systemMethod                    EQU        0                    ; system color pick method 
  53. popularMethod                    EQU        1                    ; method that chooses the most popular set of colors 
  54. medianMethod                    EQU        2                    ; method that chooses a good average mix of colors 
  55. ; color bank types 
  56. ColorBankIsCustom                EQU        -1
  57. ColorBankIsExactAnd555            EQU        0
  58. ColorBankIs555                    EQU        1
  59.  
  60. ; typedef long                 PictInfoID
  61. CommentSpec             RECORD    0
  62. count                     ds.w   1        ; offset: $0 (0)        ; number of occurrances of this comment ID 
  63. ID                         ds.w   1        ; offset: $2 (2)        ; ID for the comment in the picture 
  64. sizeof                     EQU *            ; size:   $4 (4)
  65.                         ENDR
  66.  
  67. ; typedef struct CommentSpec  CommentSpec, *CommentSpecPtr, **CommentSpecHandle
  68. FontSpec                 RECORD    0
  69. pictFontID                 ds.w   1        ; offset: $0 (0)        ; ID of the font in the picture 
  70. sysFontID                 ds.w   1        ; offset: $2 (2)        ; ID of the same font in the current system file 
  71. size                     ds.l   4        ; offset: $4 (4)        ; bit array of all the sizes found (1..127) (bit 0 means > 127) 
  72. style                     ds.w   1        ; offset: $14 (20)        ; combined style of all occurrances of the font 
  73. nameOffset                 ds.l   1        ; offset: $16 (22)        ; offset into the fontNamesHdl handle for the font’s name 
  74. sizeof                     EQU *            ; size:   $1A (26)
  75.                         ENDR
  76.  
  77. ; typedef struct FontSpec     FontSpec, *FontSpecPtr, **FontSpecHandle
  78. PictInfo                 RECORD    0
  79. version                     ds.w   1        ; offset: $0 (0)        ; this is always zero, for now 
  80. uniqueColors             ds.l   1        ; offset: $2 (2)        ; the number of actual colors in the picture(s)/pixmap(s) 
  81. thePalette                 ds.l   1        ; offset: $6 (6)        ; handle to the palette information 
  82. theColorTable             ds.l   1        ; offset: $A (10)        ; handle to the color table 
  83. hRes                     ds.l   1        ; offset: $E (14)        ; maximum horizontal resolution for all the pixmaps 
  84. vRes                     ds.l   1        ; offset: $12 (18)        ; maximum vertical resolution for all the pixmaps 
  85. depth                     ds.w   1        ; offset: $16 (22)        ; maximum depth for all the pixmaps (in the picture) 
  86. sourceRect                 ds     Rect    ; offset: $18 (24)        ; the picture frame rectangle (this contains the entire picture) 
  87. textCount                 ds.l   1        ; offset: $20 (32)        ; total number of text strings in the picture 
  88. lineCount                 ds.l   1        ; offset: $24 (36)        ; total number of lines in the picture 
  89. rectCount                 ds.l   1        ; offset: $28 (40)        ; total number of rectangles in the picture 
  90. rRectCount                 ds.l   1        ; offset: $2C (44)        ; total number of round rectangles in the picture 
  91. ovalCount                 ds.l   1        ; offset: $30 (48)        ; total number of ovals in the picture 
  92. arcCount                 ds.l   1        ; offset: $34 (52)        ; total number of arcs in the picture 
  93. polyCount                 ds.l   1        ; offset: $38 (56)        ; total number of polygons in the picture 
  94. regionCount                 ds.l   1        ; offset: $3C (60)        ; total number of regions in the picture 
  95. bitMapCount                 ds.l   1        ; offset: $40 (64)        ; total number of bitmaps in the picture 
  96. pixMapCount                 ds.l   1        ; offset: $44 (68)        ; total number of pixmaps in the picture 
  97. commentCount             ds.l   1        ; offset: $48 (72)        ; total number of comments in the picture 
  98. uniqueComments             ds.l   1        ; offset: $4C (76)        ; the number of unique comments in the picture 
  99. commentHandle             ds.l   1        ; offset: $50 (80)        ; handle to all the comment information 
  100. uniqueFonts                 ds.l   1        ; offset: $54 (84)        ; the number of unique fonts in the picture 
  101. fontHandle                 ds.l   1        ; offset: $58 (88)        ; handle to the FontSpec information 
  102. fontNamesHandle             ds.l   1        ; offset: $5C (92)        ; handle to the font names 
  103. reserved1                 ds.l   1        ; offset: $60 (96)
  104. reserved2                 ds.l   1        ; offset: $64 (100)
  105. sizeof                     EQU *            ; size:   $68 (104)
  106.                         ENDR
  107.  
  108. ; typedef struct PictInfo     PictInfo
  109. ; typedef PictInfo             *PictInfoPtr, **PictInfoHandle
  110. ;
  111. ; pascal OSErr GetPictInfo(PicHandle thePictHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  112. ;
  113.     IF ¬ GENERATINGCFM THEN
  114.         Macro
  115.         _GetPictInfo
  116.             move.w    #$0800,d0
  117.             dc.w     $A831
  118.         EndM
  119.     ELSE
  120.         IMPORT_CFM_FUNCTION    GetPictInfo
  121.     ENDIF
  122.  
  123. ;
  124. ; pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  125. ;
  126.     IF ¬ GENERATINGCFM THEN
  127.         Macro
  128.         _GetPixMapInfo
  129.             move.w    #$0801,d0
  130.             dc.w     $A831
  131.         EndM
  132.     ELSE
  133.         IMPORT_CFM_FUNCTION    GetPixMapInfo
  134.     ENDIF
  135.  
  136. ;
  137. ; pascal OSErr NewPictInfo(PictInfoID *thePictInfoID, short verb, short colorsRequested, short colorPickMethod, short version)
  138. ;
  139.     IF ¬ GENERATINGCFM THEN
  140.         Macro
  141.         _NewPictInfo
  142.             move.w    #$0602,d0
  143.             dc.w     $A831
  144.         EndM
  145.     ELSE
  146.         IMPORT_CFM_FUNCTION    NewPictInfo
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal OSErr RecordPictInfo(PictInfoID thePictInfoID, PicHandle thePictHandle)
  151. ;
  152.     IF ¬ GENERATINGCFM THEN
  153.         Macro
  154.         _RecordPictInfo
  155.             move.w    #$0403,d0
  156.             dc.w     $A831
  157.         EndM
  158.     ELSE
  159.         IMPORT_CFM_FUNCTION    RecordPictInfo
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID, PixMapHandle thePixMapHandle)
  164. ;
  165.     IF ¬ GENERATINGCFM THEN
  166.         Macro
  167.         _RecordPixMapInfo
  168.             move.w    #$0404,d0
  169.             dc.w     $A831
  170.         EndM
  171.     ELSE
  172.         IMPORT_CFM_FUNCTION    RecordPixMapInfo
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID, PictInfo *thePictInfo, short colorsRequested)
  177. ;
  178.     IF ¬ GENERATINGCFM THEN
  179.         Macro
  180.         _RetrievePictInfo
  181.             move.w    #$0505,d0
  182.             dc.w     $A831
  183.         EndM
  184.     ELSE
  185.         IMPORT_CFM_FUNCTION    RetrievePictInfo
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal OSErr DisposePictInfo(PictInfoID thePictInfoID)
  190. ;
  191.     IF ¬ GENERATINGCFM THEN
  192.         Macro
  193.         _DisposePictInfo
  194.             move.w    #$0206,d0
  195.             dc.w     $A831
  196.         EndM
  197.     ELSE
  198.         IMPORT_CFM_FUNCTION    DisposePictInfo
  199.     ENDIF
  200.  
  201.     IF OLDROUTINENAMES  THEN
  202.     ENDIF
  203.     ENDIF ; __PICTUTILS__
  204.